

/*---------------------------------------------------------
   Initializes the effect. The data is a table of data 
   which was passed from the server.
---------------------------------------------------------*/
function EFFECT:Init( data )
	
	self.Ent = data:GetEntity()
	if self.Ent == nil or self.Ent == NULL then return end

	self.Emitter = ParticleEmitter( self.Ent:GetPos() )
	
end


/*---------------------------------------------------------
   THINK
   Returning false makes the entity die
---------------------------------------------------------*/
function EFFECT:Think( )
	if self.Ent == nil or self.Ent == NULL then 
		if self.Emitter then
			self.Emitter:Finish()
		end
	return false end

	self.Pos = self.Ent:GetPos()
	self.Up = self.Ent:GetUp() * -1
			
	if math.random(1,4) == 1 then
		local particle = self.Emitter:Add( "particles/smokey", self.Pos )
		particle:SetVelocity( self.Up * math.random(50,70) )
		particle:SetDieTime( math.Rand( 0.5, 1 ) )
		particle:SetStartAlpha( math.Rand( 100, 160 ) )
		particle:SetEndAlpha( 1 )
		particle:SetStartSize( math.Rand( 1, 3 ) )
		particle:SetEndSize( math.Rand( 15, 25 ) )
		particle:SetRoll( math.Rand( 0, 360 ) )
		particle:SetRollDelta( math.Rand( -0.1, 0.1 ) )
		particle:SetColor( 255, 255, 255 )
		particle:VelocityDecay( false )
	end	


	return true
end


/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render()

	
end



